<template>
	<div>
		<div id="trip_list">
			<div id='app'>
				<ul>
					<li class="view" v-for="(a,b) in actives" v-bind:key="b">
						<div class="pic">
							<img :src="'https://yo.docshare.org.cn'+a.contentphoto">
							<div class="cont">
								<a title="" class="button" @click="itemClicked(a)">查看详情</a>
								<div class="num">
									<p><span>{{a.numbermin}}/{{a.numbermax}}</span>人报名</p>
									<p>出发时间<span>{{a.time}}</span></p>
								</div>
							</div>
							<div class="clear"></div>
						</div>
						<div class="con">
							<span>{{a.name}}</span>
							<p>{{a.introduce}}</p>
						</div>
					</li>
				</ul>
				<div id="none">
					没有更多了
				</div>
			</div>
		</div>
		<!--footer-->
		<div class="foot_h"></div>
		<div id="footer">
			<div class="first">
				<ul class="am-avg-sm-2">
					<li>
						<a title="" @click="uni.navigateTo({
							url:'../../../pages/main/index'
						})">
							<img src="https://yo.docshare.org.cn/static/images/icon-footer1-a.png" />
							<p>首页</p>
						</a>
					</li>
					<li class="active">
						<a title=""  @click="uni.navigateTo({
							url:'trip_list'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer04-a.png" />
							<p>活动</p>
						</a>
					</li>
				</ul>
			</div>
			<div class="beautiful">
				<a title=""  @click="uni.navigateTo({
					url:'../../../pages/add/my_note'
				})">
					<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer3-a.png" />
				</a>
			</div>
			<div class="last">
				<ul class="am-avg-sm-2">
					<li>
						<a title="" @click="uni.navigateTo({
							url:'../../../pages/map/map'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer2-a.png" />
							<p>地图</p>
						</a>
					</li>
					<li>
						<a title="" @click="uni.navigateTo({
							url:'../../../pageB/pages/user/user_center'
						})">
							<img alt="" src="https://yo.docshare.org.cn/static/images/icon-footer5-a.png" />
							<p>我的</p>
						</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				uni,
				usr: '',
				actives: []
			}
		},
		onLoad(option) {
			var that = this;
			if (option.id) {
				this.vid = option.id;
			}
			if(option.actives){
				that.actives = JSON.parse(option.actives) ;
			} else {
				
			uni.request({
				url: `${config.baseUrl}/active/list?token=` + uni.getStorageSync('token'),
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.actives = r.data.data;
					} else {

					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			})
			}
		},
		methods: {
			itemClicked: function(item) {
				uni.navigateTo({
					url: 'activity_detail?id=' + item.id
				})
			}
		}
	}
</script>

<style>
</style>
